package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingClassesScheduleMapper;
import com.ruoyi.teaching.domain.TeachingClassesSchedule;
import com.ruoyi.teaching.service.ITeachingClassesScheduleService;
import com.ruoyi.common.core.text.Convert;

/**
 * 排课信息Service业务层处理
 * 
 * @author William
 * @date 2022-10-17
 */
@Service
public class TeachingClassesScheduleServiceImpl implements ITeachingClassesScheduleService 
{
    @Autowired
    private TeachingClassesScheduleMapper teachingClassesScheduleMapper;

    /**
     * 查询排课信息
     * 
     * @param scheduleId 排课信息主键
     * @return 排课信息
     */
    @Override
    public TeachingClassesSchedule selectTeachingClassesScheduleByScheduleId(Long scheduleId)
    {
        return teachingClassesScheduleMapper.selectTeachingClassesScheduleByScheduleId(scheduleId);
    }

    /**
     * 查询排课信息列表
     * 
     * @param teachingClassesSchedule 排课信息
     * @return 排课信息
     */
    @Override
    public List<TeachingClassesSchedule> selectTeachingClassesScheduleList(TeachingClassesSchedule teachingClassesSchedule)
    {
        return teachingClassesScheduleMapper.selectTeachingClassesScheduleList(teachingClassesSchedule);
    }

    /**
     * 新增排课信息
     * 
     * @param teachingClassesSchedule 排课信息
     * @return 结果
     */
    @Override
    public int insertTeachingClassesSchedule(TeachingClassesSchedule teachingClassesSchedule)
    {
        teachingClassesSchedule.setCreateTime(DateUtils.getNowDate());
        return teachingClassesScheduleMapper.insertTeachingClassesSchedule(teachingClassesSchedule);
    }

    /**
     * 修改排课信息
     * 
     * @param teachingClassesSchedule 排课信息
     * @return 结果
     */
    @Override
    public int updateTeachingClassesSchedule(TeachingClassesSchedule teachingClassesSchedule)
    {
        teachingClassesSchedule.setUpdateTime(DateUtils.getNowDate());
        return teachingClassesScheduleMapper.updateTeachingClassesSchedule(teachingClassesSchedule);
    }

    /**
     * 批量删除排课信息
     * 
     * @param scheduleIds 需要删除的排课信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingClassesScheduleByScheduleIds(String scheduleIds)
    {
        return teachingClassesScheduleMapper.deleteTeachingClassesScheduleByScheduleIds(Convert.toStrArray(scheduleIds));
    }

    /**
     * 删除排课信息信息
     * 
     * @param scheduleId 排课信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingClassesScheduleByScheduleId(Long scheduleId)
    {
        return teachingClassesScheduleMapper.deleteTeachingClassesScheduleByScheduleId(scheduleId);
    }
}
